package Interpreter;

public class OperateNode implements DBNode {
    private String operate;
    private String opName;
    private DBNode optionalNode = new OptionalNode();
    @Override
    public void intperpret(Context context) throws Exception {
       operate = context.currentToken();
       switch (operate) {
        case "COPY":
            opName = "copy";
            break;
        case "MOVE":
            opName = "move";
            break;
        default:
            throw new Exception("The operation " + operate + " has not yet been implemented");
        }
        context.nextToken();
        optionalNode.intperpret(context);
    }
    @Override
    public String toString() {
        return opName + optionalNode.toString();
    }
}
